package testpackage;

import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Scope;

import aoppackage.Audience;
import aoppackage.Performance;
import normalpackage.Inner;
import normalpackage.Outer;

@Configuration
@Import({mediasystem.cdplayer.class,aoppackage.Audience.class})

@EnableAspectJAutoProxy
public class outerconfig {
	@Bean
	@Scope(value=ConfigurableBeanFactory.SCOPE_PROTOTYPE)
	public Inner inner(){
		return new Inner();
	}

	@Bean("outer")
	@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
	public Outer outer(){
		return new Outer(inner());
	}
	
	@Bean
	public Performance performance(){
		return new Performance() {
			
			@Override
			public void perform() {
				// TODO Auto-generated method stub
				System.out.println("performancing ...");
				
			}

			@Override
			public void perform2() throws Exception {
				// TODO Auto-generated method stub
				System.out.println("performancing 222...");
				
				throw new Exception();
				
			}
		};
	}
}
